import argparse

import easydict


# parser = argparse.ArgumentParser()
# parser.add_argument('--weights', nargs='+', type=str, default='./yolo/weights/yolov7-tiny.pt', help='model.pt path(s)')
# parser.add_argument('--source', type=str, default='yolo/inference/images',
#                     help='source')  # file/folder, 0 for webcam
# parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
# parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
# parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
# parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
# parser.add_argument('--view-img', action='store_true', help='display results')
# parser.add_argument('--save-txt', action='store_true', help='save results to *.txt')
# parser.add_argument('--save-conf', action='store_true', help='save confidences in --save-txt labels')
# parser.add_argument('--nosave', action='store_true', help='do not save images/videos')
# parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
# parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
# parser.add_argument('--augment', action='store_true', help='augmented inference')
# parser.add_argument('--update', action='store_true', help='update all models')
# parser.add_argument('--project', default='runs/detect', help='save results to project/name')
# parser.add_argument('--name', default='exp', help='save results to project/name')
# parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
# parser.add_argument('--no-trace', action='store_true', help='don`t trace model')
# opt = parser.parse_args()
# opt.source = '0'
# opt.view_img = True
# check_requirements(exclude=('pycocotools', 'thop'))
def create_opt(weights='./weights/yolov7.pt', source='0', project='runs/detect'):
    opt = easydict.EasyDict()
    opt.weights = weights  # model.pt path(s)
    opt.source = source  # file/dir/URL/glob, 0 for webcam
    # opt.data = data  # dataset.yaml path
    opt.img_size = 640  # inference size  int
    opt.conf_thres = 0.25  # confidence threshold
    opt.iou_thres = 0.45  # NMS IOU threshold
    opt.max_det = 1000  # maximum detections per image
    opt.device = ''  # cuda device, i.e. 0 or 0,1,2,3 or cpu
    opt.view_img = False  # show results
    opt.save_txt = False  # save results to *.txt
    opt.save_conf = False  # save confidences in --save-txt labels
    opt.save_crop = False  # save cropped prediction boxes
    opt.nosave = False  # do not save images/videos
    opt.classes = None  # filter by class: --class 0, or --class 0 2 3
    opt.agnostic_nms = False  # class-agnostic NMS
    opt.augment = True  # augmented inference
    opt.visualize = False  # visualize features
    opt.update = False  # update all models
    opt.project = project  # save results to project/name
    opt.name = 'exp'  # save results to project/name
    opt.exist_ok = False  # existing project/name ok, do not increment
    opt.line_thickness = 3  # bounding box thickness (pixels)
    opt.hide_labels = False  # hide labels
    opt.hide_conf = False  # hide confidences
    opt.half = False  # use FP16 half-precision inference
    opt.dnn = False  # use OpenCV DNN for ONNX inference
    opt.no_trace = True
    opt.agnostic_nms = True

    return opt


if __name__ == '__main__':
    o = easydict.EasyDict()
    o.e = 3  # model.pt path(s)

    print(o)
